<?php
require 'autoload.php';

$flyweight = new \DesignPatterns\Structure\Flyweight\FlyweightFactory();

$zhangsan = $flyweight->getFlyweight('170cm的模特');
$zhangsan->show('第1件L号的衣服');

$zhangsan2 = $flyweight->getFlyweight('170cm的模特');
$zhangsan2->show('第99件L号的衣服');

var_dump($zhangsan === $zhangsan2);

$lisi = $flyweight->getFlyweight('180cm的模特');
$lisi->show('第一件XXL号的衣服');


$wangwu = new \DesignPatterns\Structure\Flyweight\UnsharedConcreteFlyweight('190cm的模特');
$wangwu->show("第一件XXXL的衣服");
$wangwu->delete();
$wangwu->show("第一件XXXL的衣服");